#ifndef VSRECTANIMBLEND_H
#define VSRECTANIMBLEND_H
#include "VSTwoParamAnimBlend.h"
namespace VSEngine2
{
	/*
						
			LeftTop	 __________  RightTop
					|			|
					|			| 
					|			|
		LeftBottom	|_________	| RightBottom
					  


	   CrossFading IMMEDIATE 
					

				
					0 0,0____________1 0,1
						|				|
						|				|
						|				|
						|				|
						|				|
					2 1,0------------3 1,1

	 

	*/
	class VSStream;
	class VSGRAPHIC_API VSRectAnimBlend : public VSTwoParamAnimBlend
	{
		//RTTI
		DECLARE_RTTI;
		//PRIORITY
		

		enum	//Child Location
		{
			CL_LEFT_TOP,
			CL_RIGTH_TOP,
			CL_LEFT_BOTTOM,
			CL_RIGHT_BOTTOM,
			CL_MAX
		};

	public:
		virtual ~VSRectAnimBlend();

		VSRectAnimBlend(const VSUsedName & ShowName,VSAnimTree * pAnimTree);

	protected:

		VSArray<VSAnimAtom> m_BlendBoneMatrix[2];
		VSRectAnimBlend();
		virtual bool ComputeOutBoneMatrix(double dAppTime);
	public:
		static bool RegisterMainFactory();

	private:
		static bool InitialClassFactory();	
		static VSObject * FactoryFunc();
		static bool ms_bRegisterMainFactory;
	public:
// 		
// 		virtual unsigned int DiskUse()const;
// 
// 		virtual bool Save(VSStream & rStream,unsigned int &iSaveUse)const;
// 		virtual bool Load(VSStream & rStream,unsigned int &iSaveUse);

		virtual bool Link(VSStream & rStream);
	public:
		virtual bool Clone(const VSObject *pObject,unsigned int uiType);

	};
	typedef VSPointer<VSRectAnimBlend> VSRectAnimBlendPtr;
}
#endif